#!/bin/sh
# Usage: script/boostrap
# Ensures all dependencies are installed locally.

set -e
cd "$(dirname "$0")/.."

if [ "$(uname -s)" = "Darwin" ]; then
  echo "==> Bootstrapping Homebrew OSX environment"
  brew update >/dev/null
  brew bundle check &>/dev/null || brew bundle

  brew setup-nginx-conf classroom . config/dev/nginx.conf.erb
fi

echo "==> Installing gem dependencies…"
bundle install --without production

echo "==> Installing javascript dependencies…"
yarn install
